import request from '@/plugin/axios'

export function fetchList (query) {
  return request({
    url: '/booking/list/page',
    method: 'get',
    params: query,
    loading: {
      type: 'nprogress',
      interval: 500
    }
  })
}

export function getUnReadList () {
  return request({
    url: '/booking/getUnReadList',
    method: 'get',
    loading: {
      type: 'nprogress',
      interval: 500
    }
  })
}

export function changeStatusById (id) {
  return request({
    url: '/booking/changeStatusById?id=' + id,
    method: 'put',
    loading: {
      type: 'nprogress',
      interval: 500
    }
  })
}

export function del (id) {
  return request({
    url: '/booking/delete/' + id,
    method: 'delete',
    loading: {
      type: 'nprogress',
      interval: 500
    }
  })
}

export function weekButtonList () {
  return request({
    url: '/booking/getBookingCountByUserId',
    method: 'get'
  })
}